//
//  WL_showPriceList.swift
//  ZYA
//
//  Created by 邱仙凯 on 2024/9/20.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit

class WL_showPriceList: ShowPriceBaseListVC {
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "出价记录"

        tableView.register(WL_showPriceCell.self, forCellReuseIdentifier: WL_showPriceCell.identifier)

        let rightbtn = UIButton.creat4Item(image: UIImage(named: "all_record")!) { _ in
            getRecordListtt(zDtradeType: "", zb_id: self.z_zb_id, staff_id: "", billtitle: self.billTitle, zb_source: "1", s_data_source: "0")
        }
        let right = UIBarButtonItem(customView:rightbtn)
        self.navigationItem.rightBarButtonItem = right
    }

    override func configAPI() {
        api = API.tender(.queryTbInfoList(page: "\(page)", size: "10", z_zb_id: z_zb_id, z_title: "",followTag: followTag))
    }
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let one = self.dataArray[indexPath.row]
        
        guard let cell = tableView.dequeueReusableCell(withIdentifier: WL_showPriceCell.identifier, for: indexPath) as? WL_showPriceCell else {
            fatalError("cell error")
        }
        
        one.innerType = .chujiaRecordKHW
        cell.makeConstrainsts()
        cell.oper_btn.addTouchUpInSideAction {[one] _ in
            let nav = BaseNavigationController()
            let vc = ZyaCarInfoVC()
            vc.dataArray = one.carInfo
            nav.viewControllers = [vc]
            self.present_FullScreen(to: nav)
            
            
        }
      
        cell.one = one
        cell.mychujiaBtn.addTouchUpInSideAction { [one] _ in
            
            
          
            getRecordListtt(zDtradeType: one.zDtradeType.unwrap,zb_id: one.zZbId.unwrap, staff_id: one.zStaffId.unwrap,billtitle: self.billTitle,zb_source: "1",s_data_source: "0")
                 
               
           
           
        }
        
        return cell
        
        
        
        
        
        
    }
}
